<?php

class LancamentoDao extends Dao {

    public function injectDependencies() {

    }

    public function findReleasesByCustomer($IDCliente) {
        $this->initConnection();
        $StSql = TQuery::getSqlFindReleasesByCustomer($IDCliente);
        $this->tMysqli->escape($IDCliente);
        $ArLancamentos = array();
        $tQuery = $this->tMysqli->exec($StSql);
        while($ArReleaseData = mysqli_fetch_assoc($tQuery)) {
            $ArLancamentos[] = new Lancamento($ArReleaseData, $this->tMysqli);
        }
        $this->closeConnection();
        return $ArLancamentos;
    }

    public function findById($IDPayment) {
        $this->initConnection();
        $this->tMysqli->escape($IDPayment);
        $StSql = TQuery::getSqlFindReleasesById($IDPayment);
        $this->tMysqli->exec($StSql);
        $ArReleaseData = $this->tMysqli->result(0);
        $Lancamento = new Lancamento($ArReleaseData, $this->tMysqli);
        $this->closeConnection();
        return $Lancamento;
    }

}

?>
